﻿using System;
using System.Web.Mvc;
using System.Web.Routing;
using YawetagLib.System.Facade.Services;

namespace YawetagDemo.WebUI.Controllers
{
    public class ControllerFactory : DefaultControllerFactory
    {
        protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
        {
            return controllerType != null 
                ? (IController)Activator.CreateInstance(controllerType, FacadeFactoryBuilder.GetFactory())
                : null;
        }
    }
}